// 导入数据库操作模块
const db = require('../db/index')

//获取公司基本信息
exports.getCompanyInfo = (req, res) => {
    const query = req.body
    const sql = 'select * from company '
    db.query(sql, (err, results) => {
        if (err) return res.cc(err)
        res.send(results)
    })
}


//填写公司基本信息
exports.setCompanyInfo = (req, res) => {
    const query = req.body
    const sql = 'insert into  company set ? '
    db.query(sql, {
        companyName: query.companyName,
        commonName: query.commonName,
        fullName: query.fullName,
        Info: Info,
    }, (err, results) => {
        if (err) return res.cc(err)
        res.send(results)
    })
}
//修改公司基本信息
exports.updateCompanyInfo = (req, res) => {
    const query = req.body
    const sql = 'update company set  ? '
    db.query(sql, {
        companyName: query.companyName,
        commonName: query.commonName,
        fullName: query.fullName,
        Info: Info,
    }, (err, results) => {
        if (err) return res.cc(err)
        res.send(results)
    })
}
